package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_theme")
public class ThemeBean {
    @TableId(value = "pk_themeId", type = IdType.AUTO)
    private Integer id;
    @TableField("t_title")
    private String title;
    @TableField("t_content")
    private String content;
    @TableField("t_date")
    private LocalDate date = LocalDate.now();
    @TableField(exist = false)
    private Integer replyNum;
    @TableField("fk_userId")
    private Integer userId;
    @TableField(exist = false)
    private UserBean user;
    @TableField("fk_channelId")
    private Integer channelId;
    @TableField(exist = false)
    private ChannelBean channel;

    public ThemeBean() {
    }

    public ThemeBean(String title, String content, Integer userId, Integer channelId) {
        this.title = title;
        this.content = content;
        this.userId = userId;
        this.channelId = channelId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(Integer replyNum) {
        this.replyNum = replyNum;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    @Override
    public String toString() {
        return "ThemeBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", replyNum=" + replyNum +
                ", userId=" + userId +
                ", user=" + user +
                ", channelId=" + channelId +
                ", channel=" + channel +
                '}' + "\n";
    }
}
